﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.master"
    CodeFile="ManageCodeMapping.aspx.vb" Inherits="WebForm_ManageCodeMapping" %>
<%@ Register Namespace="My" TagPrefix="cc1" %>
<%@ Register Assembly="App_Code" Namespace="My" TagPrefix="My" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
  function   JHshNumberText()   
  {   
      if(!(((window.event.keyCode>=48)&&(window.event.keyCode<=57))||(window.event.keyCode==13)||(window.event.keyCode==46)||(window.event.keyCode==45)))   
      {   
            window.event.keyCode=0;   
      }   
  }   
</script> 
    <table width="95%" align="Center">
        <tr>
            <td align="center">
                <asp:Label ID="Title" runat="server" SkinID="title" meta:resourcekey="Title"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
            
            <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                 <asp:HiddenField ID="hiUID" runat="server" />
                <TABLE id="table1" cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                        <TR>
                            <TD align=center><TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
                                <TBODY>
                                    <TR>
                                        <TD align=left>
                                            <asp:Panel id="pnlADD" runat="server">
                                                <asp:FormView id="fv" runat="server" DefaultMode="Insert" DataKeyNames="EmployeeID">
                                                    <InsertItemTemplate>
                                                        <TABLE>
                                                            <TBODY>
                                                                <TR>
                                                                    <TD align=right>
                                                                        <asp:Label id="lblTableName" runat="server" meta:resourcekey="lblTableName" ></asp:Label>
                                                                    </TD>
                                                                    <TD>
                                                                        <asp:DropDownList id="ddlTableName" runat="server"   OnSelectedIndexChanged="ddlTableName_SelectedIndexChanged" OnDataBound="ddlTableName_DataBound" AutoPostBack="True" DataTextField="Text" DataValueField="TableName">
                                                                        </asp:DropDownList>                                                              
                                                                    </TD>
                                                                    <TD align=right>
                                                                            <asp:Label id="lblColumnName" runat="server" meta:resourcekey="lblColumnName"></asp:Label>
                                                                    </TD>
                                                                    <TD>
                                                                            <asp:DropDownList id="ddlColumnName" runat="server" OnSelectedIndexChanged="ddlColumnName_SelectedIndexChanged" OnDataBound="ddlColumnName_DataBound" AutoPostBack="True" DataTextField="Text" DataValueField="ColumnName">
                                                                            </asp:DropDownList>
                                                                    </TD>
                                                                    <TD  align=right>
                                                                        <asp:Label id="lblValue" runat="server" meta:resourcekey="lblValue"></asp:Label>
                                                                    </TD>
                                                                    <TD>
                                                                        <asp:TextBox id="txtValue" runat="server" Text='<%# Bind("Value") %>' MaxLength="50"></asp:TextBox>
                                                                    </TD>

                                                                    <TD align=left>
<%--                                                                        <asp:Label id="lblSequence" runat="server" meta:resourcekey="lblSequence"></asp:Label> 
                                                                        <asp:TextBox id="txtSequence" onkeypress="JHshNumberText()" runat="server" Text='<%# Bind("Sequence") %>'  MaxLength="3" Width="36px"></asp:TextBox>
--%>                                                                    </TD>
                                                                </TR>
                                                                <TR>
                                                                    <TD align=right>
                                                                        <asp:Label id="lblText" runat="server" meta:resourcekey="lblText"></asp:Label>
                                                                    </TD>
                                                                    <TD>
                                                                        <asp:TextBox id="txtText" runat="server" Text='<%# Bind("Text") %>' MaxLength="50"></asp:TextBox>
                                                                    </TD>
                                                                     <TD align=right>
                                                                        <asp:Label id="lblChnText" runat="server" meta:resourcekey="lblChnText"></asp:Label>
                                                                    </TD>
                                                                    <TD>
                                                                        <asp:TextBox id="txtChnText" runat="server" Text='<%# Bind("ChnText") %>' MaxLength="50"></asp:TextBox>
                                                                    </TD>
                                                                     <TD align=right>
                                                                        <asp:Label id="lblEngText" runat="server" meta:resourcekey="lblEngText"></asp:Label>
                                                                    </TD>
                                                                    <TD>
                                                                        <asp:TextBox id="txtEngText" runat="server" Text='<%# Bind("EngText") %>' MaxLength="50"></asp:TextBox>
                                                                    </TD>
                                                                    <TD align=left colspan="2">
                                                                        <asp:CheckBox ID="chkActive" runat="server" meta:resourcekey="chkActive" Checked="true"></asp:CheckBox>
                                                                        <asp:Button ID="btnAdd" ValidationGroup="vInsert" CommandName="Insert" runat="server" meta:resourcekey="btnAdd" />
                                                                        <asp:RequiredFieldValidator id="rfvTableName" runat="server" meta:resourcekey="rfvTableName" ValidationGroup="vInsert"  ControlToValidate="ddlTableName" Display="None" SetFocusOnError="True" InitialValue="0">*</asp:RequiredFieldValidator>
                                                                        <asp:RequiredFieldValidator id="rfvColumnName" runat="server" meta:resourcekey="rfvColumnName" ValidationGroup="vInsert"  ControlToValidate="ddlColumnName" Display="None" SetFocusOnError="True" InitialValue="0">*</asp:RequiredFieldValidator>
                                                                        <asp:RequiredFieldValidator id="rfvText" runat="server" meta:resourcekey="rfvText" ValidationGroup="vInsert" ControlToValidate="txtText" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                                                        <asp:RequiredFieldValidator id="rfvChnText" runat="server" meta:resourcekey="rfvChnText" ValidationGroup="vInsert" ControlToValidate="txtChnText" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                                                        <asp:RequiredFieldValidator id="rfvEngText" runat="server" meta:resourcekey="rfvEngText" ValidationGroup="vInsert" ControlToValidate="txtEngText" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                                                        <asp:RequiredFieldValidator id="rfvValue" runat="server" meta:resourcekey="rfvValue" ValidationGroup="vInsert"  ControlToValidate="txtValue" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                                                        <asp:ValidationSummary id="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="vInsert"></asp:ValidationSummary> 
                                                                     </TD>
                                                                 </TR>
                                                            </TBODY>
                                                         </TABLE>
                                                       </InsertItemTemplate>
                                                    </asp:FormView>
                                               </asp:Panel> 
             <BR />
             <asp:Panel id="pnlList" runat="server">
                   <TServerControl:TGridView ID="gv" runat="server" AllowHoverEffect="False" AllowHoverSelect="False"
                            AllowPaging="True"  ShowFooterWhenEmpty="False" ShowHeaderWhenEmpty="False"
                            SkinID="pager" TotalRowCount="0" AutoGenerateColumns="False" DataKeyNames="ID">                         
                            <Columns>
                            <asp:TemplateField HeaderText="TableName" SortExpression="TableName_Text" meta:resourceKey="gvTableName">
       
                                 <ItemTemplate>
                                    <asp:Label id="lblTableName" runat="server" Text='<%# Eval("TableName") %>' visible="false"></asp:Label> 
                                    <asp:Label id="Label1" runat="server" Text='<%# Eval("TableName_Text") %>'></asp:Label> 
                                  </ItemTemplate>
                                  <ItemStyle HorizontalAlign="Center"></ItemStyle>
                             </asp:TemplateField>
                             <asp:TemplateField HeaderText="ColumnName" SortExpression="ColumnName_Text" meta:resourceKey="gvColumnName">
                                <ItemTemplate>
                                     <asp:Label id="lblColumnName" runat="server" Text='<%# Eval("ColumnName") %>' visible="false"></asp:Label> 
                                     <asp:Label runat="server" Text='<%# Eval("ColumnName_Text") %>' id="Label2"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Text" SortExpression="Text" meta:resourceKey="gvText">
                                <EditItemTemplate>
                                    <asp:TextBox id="txtText" runat="server" Text='<%# Bind("Text") %>' MaxLength="50"></asp:TextBox>
                                    <asp:RequiredFieldValidator id="rfvText" runat="server" meta:resourcekey="rfvText" ValidationGroup="vUpdate" ControlToValidate="txtText" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblText" runat="server" Text='<%# Bind("Text") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="ChnText" SortExpression="ChnText" meta:resourceKey="gvChnText">
                                <EditItemTemplate>
                                    <asp:TextBox id="txtChnText" runat="server" Text='<%# Bind("ChnText") %>' MaxLength="50"></asp:TextBox>
                                    <asp:RequiredFieldValidator id="rfvChnText" runat="server" meta:resourcekey="rfvChnText" ValidationGroup="vUpdate" ControlToValidate="txtChnText" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblChnText" runat="server" Text='<%# Bind("ChnText") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="EngText" SortExpression="EngText" meta:resourceKey="gvEngText">
                                <EditItemTemplate>
                                    <asp:TextBox id="txtEngText" runat="server" Text='<%# Bind("EngText") %>' MaxLength="50"></asp:TextBox>
                                    <asp:RequiredFieldValidator id="rfvEngText" runat="server" meta:resourcekey="rfvEngText" ValidationGroup="vUpdate" ControlToValidate="txtEngText" Display="None" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblEngText" runat="server" Text='<%# Bind("EngText") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                             <asp:TemplateField HeaderText="Value" SortExpression="Value" meta:resourceKey="gvValue">
                                <ItemTemplate>
                                    <asp:Label ID="lblValue" runat="server" Text='<%# Bind("Value") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Sequence" SortExpression="Sequence" meta:resourceKey="gvSequence">
                                <EditItemTemplate>
                                    <asp:TextBox id="txtSequence" runat="server" onkeypress="JHshNumberText()" Text='<%# Bind("Sequence") %>'  Width="36px" MaxLength="3"></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                     <asp:Label runat="server" Text='<%# Bind("Sequence") %>' id="Label5"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Active" SortExpression="Active" meta:resourceKey="gvActive">
                                    <EditItemTemplate>
                                       <asp:CheckBox ID="chkActive" runat="server" meta:resourcekey="chkActive" Checked='<%# Bind("IsActive") %>'></asp:CheckBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                       <asp:Label runat="server" Text='<%# Bind("Active") %>' id="Label7"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>                                
                                <asp:TemplateField>
                                    <EditItemTemplate>
                                        <asp:Button id="linkbUpdate" runat="server" meta:resourcekey="linkbUpdate" ValidationGroup="vUpdate" CommandName="Update" ForeColor="Black"></asp:Button>&nbsp;
                                        <asp:Button id="linkbCancel" runat="server" meta:resourcekey="linkbCancel" CommandName="Cancel" ForeColor="Black"></asp:Button> 
                                        <asp:ValidationSummary id="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="vUpdate" ></asp:ValidationSummary> 
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                         <asp:Button id="linkbEdit" runat="server" CommandName="Edit" meta:resourcekey="linkbEdit"></asp:Button>&nbsp;
                                            <asp:Button id="linkbDelete" runat="server" CommandName="Delete" meta:resourcekey="linkbDelete"></asp:Button>
                                            <ajaxToolkit:ConfirmButtonExtender TargetControlID="linkbDelete" ID="cbelinkbDelete" meta:resourcekey="cbelinkbDelete" runat="server">
                                            </ajaxToolkit:ConfirmButtonExtender>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                 </asp:TemplateField>
                            </Columns>
                         </TServerControl:TGridView> 
                           <asp:HiddenField ID="hiDBName" runat="server" />
                       </asp:Panel>
                    </TD>
                 </TR>
               </TBODY>
              </TABLE>
             </TD>
            </TR>
           </TBODY>
          </TABLE>
        </ContentTemplate>
      </asp:UpdatePanel> 
     </td>
    </tr>
   </table>
</asp:Content>
